﻿<%@ Page Title="微信扫描授权登录" Language="C#" AutoEventWireup="true" CodeBehind="WeixinQRScan.aspx.cs" Inherits="ZLCMS.Web.Wap.Member.WeixinQRScan" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    
    <title>微信登录</title>
    <script src="/Wap/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="/Wap/lib/jquery/jquery.json-2.2.min.js" type="text/javascript"></script>
    <script src="/wap/lib/jquery/jquery.cookie.js" type="text/javascript"></script>
    <script src="/Wap/lib/command/Command.js" type="text/javascript"></script>
</head>
<body>
<div>
	
    <!--S content -->
	<div style="text-align: center; margin-top: 40%;">
		<!--s user_center-->
            <p>微信通过扫一扫请求授权登录</p>
            <input style="padding: 0.5em 1em; margin-top: 2em; color: #fff;border:none; background-color:#1680d7" type="button" value="确认登录" onclick="confirmScan();"/>
        <!--e user_center-->
 	</div>
    <!--E content -->
	
</div>
<!--E page -->


 <script type="text/javascript">
     function confirmScan() {
        var param = { CheckString: '<%=Request["ckstr"] %>' };
        $(document).executeCommand({

            successCallBack: function (result, totalcnt) {
                if (result.Status == '1') { alert('ok'); }
                else {
                    //每隔两秒查询条码状态
                    setTimeout(function () {
                        checkQRScan();
                    }, 2000);
                }
            },
            errorCallback: function (errorCode, msg) {
                showTips(msg);
            }
        }

    , 'Member.ConfirmQrScan', param);
    }

</script>
</body>
</html>